﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace ARchGL.Platform.Electrocar.Core
{
    /// <summary>
    /// 模型结构信息 数据实体
    /// </summary>
    [Table("ev_modeldirectorys")]
    public class ModelDirectorys : KeyValueBase
    {
        /// <summary>
        /// 项目标识（车型标识）
        /// </summary>
        public Guid ProjectId { get; set; }
        /// <summary>
        /// 编号
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 类型：1总成，2零件
        /// </summary>
        public ModelDirectoryType Type { get; set; }
        /// <summary>
        /// 已绑定零件数
        /// </summary>
        public int Count { get; set; }
        /// <summary>
        /// 模型标识
        /// </summary>
        public string ModelId { get; set; }
    }

    /// <summary>
    /// 键值对数据实体基类
    /// </summary>
    public abstract class KeyValueBase : Entity<Guid>, ICreationAudited, IHasModificationTime
    {
        /// <summary>
        /// 父级标识
        /// </summary>
        public Guid ParentId { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }
        /// <summary>
        /// 级别
        /// </summary>
        public int Level { get; set; }
        /// <summary>
        /// 创建用户标识
        /// </summary>
        public long? CreatorUserId { get; set; }
        /// <summary>
        /// 创建用户名称
        /// </summary>
        public string CreatorUserName { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? LastModificationTime { get; set; }
        /// <summary>
        /// 删除用户id
        /// </summary>
        public long? DeleterUserId { get; set; }
        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? DeletionTime { get; set; }

        /// <summary>
        /// 主机/租户
        /// </summary>
        public int TenantId { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }
    }
}
